package com.zhku.controller;

import com.zhku.entity.User;
import com.zhku.service.IUserService;
import com.zhku.service.QRService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @BelongsProject: SpringBoot_School_Work
 * @BelongsPackage: com.zhku.controller
 * @Author: "deweyMDH"
 * @CreateTime: 2023-04-06  10:19
 * @Version: 1.0
 */
@RestController
public class QRController {
    @Autowired
    QRService qrService;

    @RequestMapping(value = "/code")
    public void generateUserPass(Long userid, HttpServletResponse response) throws IOException {
        // 生二维码二进制流
        qrService.generateStream(userid, response);
    }
}
